/*
 * @Descripttion: 添加路由中间件
 * @version: 1.0
 * @Author: 自由如风
 * @Date: 2021-05-02 10:30:46
 * @LastEditors: 自由如风
 * @LastEditTime: 2021-05-04 12:55:03
 */
const users = require('./users')
const nurse = require('./nurse')
const doctor = require('./doctor')
const patient = require('./patient')

const koaRouter = require('koa-router')
const router = new koaRouter()

router.prefix('/api')

router.use(users.routes(), users.allowedMethods())
router.use(nurse.routes(), nurse.allowedMethods())
router.use(doctor.routes(), doctor.allowedMethods())
router.use(patient.routes(), patient.allowedMethods())

module.exports = router;

// module.exports = function (app) {
//     app.use(users.routes(), users.allowedMethods())
//     app.use(nurse.routes(), nurse.allowedMethods())
//     app.use(doctor.routes(), doctor.allowedMethods())
//     app.use(patient.routes(), patient.allowedMethods())
// }
